package com.maoxx.humanresourcemanage_service.controller;

import com.maoxx.humanresourcemanage_service.dto.ResponseDTO;
import com.maoxx.humanresourcemanage_service.service.HomeService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @className: HomeController
 * @author: Maoxx
 * @date: 2024/11/11 22:51
 * @Version: 1.0
 * @description:
 */


@RestController
@RequestMapping("/home")
public class HomeController {

    @Resource
    private HomeService homeService;

    @GetMapping("/staff")
    public ResponseDTO getStaffData() {
        return homeService.getStaffData();
    }

    @GetMapping("/count")
    public ResponseDTO getCountData() {
        return homeService.getCountData();
    }


    @GetMapping("/city")
    public ResponseDTO getCityData() {
        return homeService.getCityData();
    }

    @GetMapping("/attendance")
    public ResponseDTO getAttendanceData(@RequestParam Integer id, String month) {
        return homeService.getAttendanceData(id,month);
    }

    @GetMapping("/department")
    public ResponseDTO getDepartmentData() {
        return homeService.getDepartmentData();
    }

}
